﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DadayunApi.Model
{
    public class ReportTplDetail: ReportTemplateInfo
    {
        public bool TotalSummary { get; set; }
        public bool GroupSummary { get; set; }
        public string DefaultGroupField { get; set; }
        public bool ForceFit { get; set; }
        public string MainDataSource { get; set; }
        public string Creator { get; set; }
        public string TableMap { get; set; }
    
        public string SortField { get; set; }
        public string SortDirection { get; set; }
        public string DistanceSortConfig { get; set; }
        public int QueryColumnCount { get; set; }
        public string DefaultRange { get; set; }
        public string Aggregator { get; set; }
        //"MeasureField": "[]",
        public string AggregationTitle { get; set; }
    
        public int PageSize { get; set; }
        public bool IsReport { get; set; }
        public bool ShowDraftData { get; set; }
        public bool IsTabGrouping { get; set; }
        public string TabGroupingField { get; set; }
        public string QueryMode { get; set; }
        public string ClickQureyReportTplId { get; set; }
        public string ClickQueryReportColumns { get; set; }
        public string ClickQueryFields { get; set; }
        public string QueryModes { get; set; }
        public string QueryNormalName { get; set; }
        public string QueryTreeName { get; set; }
        public string QueryCascadeFields { get; set; }
        public string QueryFuzzySearchColumns { get; set; }
        public string QueryFuzzySearchEmptyText { get; set; }
        //"QueryGridsConfig": null,
    
        public string BatchProcessorConfiguration { get; set; }
        
        public bool RemoveDuplicate { get; set; }
        //"MapConfig": null,
        //"LayoutGraphConfig": null,

        //public ReportColumn[] ReportColumns { get; set; }
        //public QueryColumn[] QueryColumns { get; set; }
    }

    public class BatchProcessorConfiguration
    {
        //": "{\"batchModeEnable\":true,\"batchMode\":1,\"listInputCfg\":{\"actionType\":2,\"btnActionText\":*\"发起采购申请\",\"tempFolderText\":\"购物车\",\"wfTplId\":\"8ac78f4c-a7eb-4d0c-ab8e-19930fa4ec6f\",\"wfTplName\":\"采购申请\",*\"formTplId\":\"240ed22e-b775-4c80-9050-f73b8843f7a4\",\"formTplName\":\"采购申请单\",\"subEntityFormId\":*\"930a4ebc-2a8e-4502-8b20-abd7cfb3aa91\",\"maps\":[{\"ReportColumn\":\"名称\",\"FormField\":\"采购货品清单-名称\"},{\"ReportColumn*\":\"品牌\",\"FormField\":\"采购货品清单-品牌\"},{\"ReportColumn\":\"系列\",\"FormField\":\"采购货品清单-系列\"},{\"ReportColumn\":*\"型号\",\"FormField\":\"采购货品清单-型号\"},{\"ReportColumn\":\"产品类别\",\"FormField\":\"采购货品清单-类别\"},{\"RecId\":\"ext-*gen1069\",\"ReportColumn\":\"测试\",\"FormField\":\"采购货品清单-金额\"}]},\"batchFormEditorCfg\":{},\"batchTaskCfg\":{}}",
        //{"listInputCfg":{},"batchModeEnable":true,"batchMode":2}
        public bool BatchModeEnable { get; set; }
        public int BatchMode { get; set; }
        public ListInputConfiguration ListInputCfg { get; set; }
    }
    public class ListInputConfiguration
    {
        public int ActionType { get; set; }
        public string btnActionText { get; set; }
        public string tempFolderText { get; set; }
        public string wfTplId { get; set; }
        public string wfTplName { get; set; }
        public string formTplId { get; set; }
        public string formTplName { get; set; }
        public string subEntityFormId { get; set; }
        public ReportMap[] ReportMaps { get; set; }

        //\"batchFormEditorCfg\":{},\"batchTaskCfg\":{}
    }
    public class ReportMap
    {
        public string ReportColumn { get; set; }
        public string FormField { get; set; }
       
    }
    public class ReportColumn
    {
        public string Id { get; set; }
        public string ReportTplId { get; set; }
        public string FormId { get; set; }
        public string FieldId { get; set; }
        public string FieldMap { get; set; }
        public string TableMap { get; set; }
        public int ColumnWidth { get; set; }
        //  "Summary": null,
        //  "Level": null,
        public string Header { get; set; }
          public int DataType { get; set; }
        //"NumType": null,
        //"TailDigits": null,
        //"Unit": null,
        public string TimeZone { get; set; }
        public bool IsDate { get; set; }
        public bool IsAddress { get; set; }
        public bool IsPicture { get; set; }
        public bool IsAttachment { get; set; }
        public int OrderIndex { get; set; }
        public bool IsFormulation { get; set; }
        // "Formulation": null,
        public bool IsOperator { get; set; }
        public bool IsOperateTime { get; set; }
        public string WFTplId { get; set; }
        public string WFNodeId { get; set; }
        public bool Hidden { get; set; }
        // "Color": null,
        //"ColumnStyle": null,
        //"DataFormat": null,
        // "DataLink": null,
        public string InternationalHeader { get; set; }
        public bool UseVisualPrecise { get; set; }
        public bool CalculateAfterPaging { get; set; }
        public bool GetValueFromCache { get; set; }
        public string CacheKeyPreString { get; set; }
        public string CacheKeyColumns { get; set; }
        public bool C { get; set; }
        public bool R { get; set; }
        public bool LU { get; set; }
        public bool U { get; set; }
        public bool D { get; set; }
        public bool IgnoreDefault { get; set; }
        public bool SU { get; set; }
        public bool Control { get; set; }
        public bool Veto { get; set; }
        public bool Export { get; set; }
    }
    public class QueryColumn
    {
        public string Id { get; set; }
        public string ReportTplId { get; set; }
        public string OperatorList { get; set; }
        public string DefaultOperator { get; set; }
        public bool IsPopular { get; set; }
        public int OrderIndex { get; set; }
        public bool ShowOperator { get; set; }
        public string FieldMap { get; set; }
        public string DatetimeQueryField { get; set; }
        public int DataType { get; set; }
        public string NumType { get; set; }
        public string TailDigits { get; set; }
        public string Unit { get; set; }
        public string Header { get; set; }
        public string Summary { get; set; }
        public string TimeZone { get; set; }
        public bool IsDate { get; set; }
        public bool IsAddress { get; set; }
        //"Level": null,
        public string FieldId { get; set; }
        public string FormId { get; set; }
        public string WFTplId { get; set; }
        public string WFNodeId { get; set; }
        public bool IsDefaultTimeCondition { get; set; }
        public bool IsOperator { get; set; }
        public bool IsOperateTime { get; set; }
        public string DefaultValue { get; set; }
        public bool IsLock { get; set; }
        public string InternationalHeader { get; set; }
        public bool IsQueryHidden { get; set; }
        public bool C { get; set; }
        public bool R { get; set; }
        public bool LU { get; set; }
        public bool U { get; set; }
        public bool D { get; set; }
        public bool IgnoreDefault { get; set; }
        public bool SU { get; set; }
        public bool Control { get; set; }
        public bool Veto { get; set; }
        public bool Export { get; set; }
    }
}
